package com.github.aqiu202.ideayapi.parser.support.javadoc;

import com.github.aqiu202.ideayapi.constant.DocCommentConstants;
import com.github.aqiu202.ideayapi.parser.support.YApiSupport;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiField;

import java.util.Objects;

public class YApiJavaDocSupport implements YApiSupport {

    public static final YApiJavaDocSupport INSTANCE = new YApiJavaDocSupport();


    @Override
    public boolean isIgnored(PsiField field, PsiClass psiClass) {
        if (Objects.isNull(field.getDocComment())) {
            return false;
        }
        String[] ignoreString = field.getDocComment().getText().split(DocCommentConstants.TAG_IGNORE);
        if (ignoreString.length > 1) {
            return true;
        }
        return YApiSupport.super.isIgnored(field, psiClass);
    }
}
